package com.quantdo.qtm.linux.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.quantdo.qtm.interfaces.common.QuantdoResponse;
import com.quantdo.qtm.interfaces.linux.pojo.monitor.query.LinuxStatusPointQuery;
import com.quantdo.qtm.linux.service.LinuxMonitorService;

@RestController
@RequestMapping("linux")
public class LinuxMonitorController {

    @Autowired
    private LinuxMonitorService monitorService;
    /**
     * CPU使用率
     * @return
     */
    @RequestMapping("selectcpurate")
    @ResponseBody
    public QuantdoResponse<?> selectCpuRate(LinuxStatusPointQuery statusPointQuery) {
        return monitorService.selectCpuRate(statusPointQuery);
    }
    /**
     * 内存使用率
     * @return
     */
    @RequestMapping("selectmemoryrate")
    @ResponseBody
    public QuantdoResponse<?> selectMemoryRate(LinuxStatusPointQuery statusPointQuery) {
        return monitorService.selectMemoryRate(statusPointQuery);
    }
    /**
     * 磁盘使用率
     * @return
     */
    @RequestMapping("selectdiskrate")
    @ResponseBody
    public QuantdoResponse<?> selectDiskRate(LinuxStatusPointQuery statusPointQuery) {
        return monitorService.selectDiskRate(statusPointQuery);
    }
}
